/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.entity;

import com.chlitina.store.common.persistence.BaseEntity;
import com.chlitina.store.modules.base.entity.StoreProduct;

/**
 * 客户采纳方案与产品复合主键
 * @author lvbo
 * @version 2013-06-20
 */
public class CustomerSolutionProductPK extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private CustomerSolution customerSolution;//客户采纳方案
	private StoreProduct storeProduct;//产品

	public CustomerSolutionProductPK() {
	}

	public CustomerSolution getCustomerSolution() {
		return customerSolution;
	}

	public void setCustomerSolution(CustomerSolution customerSolution) {
		this.customerSolution = customerSolution;
	}


	public StoreProduct getStoreProduct() {
		return storeProduct;
	}

	public void setStoreProduct(StoreProduct storeProduct) {
		this.storeProduct = storeProduct;
	}
	
	@Override
	public int hashCode() {
		return this.customerSolution.hashCode() + this.storeProduct.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final CustomerSolutionProductPK other = (CustomerSolutionProductPK) obj;
		if (customerSolution.getId() == other.getCustomerSolution().getId() &&
				storeProduct.getId() == other.getStoreProduct().getId()) {
			return true;
		} 
		return false;
	}
}


